package hy.day2_read_confgi.controller;

import hy.day2_read_confgi.YmlFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MyCtrl {
    @Autowired
    Environment env;
    @Autowired
    YmlFactory yml;

    @ResponseBody
    @RequestMapping("/cfg")
    public String cfg(){
        return env.getProperty("person.name")+"\t"+env.getProperty("person.birth")+"\t"+yml;
    }

}
